<!--
  @author LiSong
  @date 2023-6-30
  @description 省级经办
-->
<template>
  <div class="home-panel">
    <div class="home-item-wrapper">
      <div class="home-item-panel">
        <HomeTodoCard :cardItems="projApplyItems"/>
      </div>
    </div>
    <div class="home-item-wrapper">
      <div class="home-item-panel">
        <HomeAuditLogs />
      </div>
    </div>
  </div>
</template>

<script setup>
import HomeUtils from '../config/home-utils'
import HomeTodoCard from '../items/HomeTodoCard.vue'
import HomeAuditLogs from '../items/HomeAuditLogs.vue'

const props = defineProps({
  loading: { type: Boolean, default: false },
  todoData: { type: [ Object, Array ] }
})
// 项目排序
const projSortItem = ref([])
// 项目申报
const projApplyItems = ref([])
// 项目上报
const projReportItems = ref([])

watch(
  () => props.todoData,
  (newValue, oldValue) => {
    const { sortItems, applyItems, reportItems } = HomeUtils.tranfHandleData(newValue)
    projSortItem.value = sortItems
    projApplyItems.value = applyItems
    projReportItems.value = reportItems
  },
  {deep: false, immediate: false}
)

const cardItems = [
  {
    name: '一般项目',
    icon: 'reserve',
    infoList: [
      { label: '未送审', value: 25, path: 'generic-reserve-apply', status: '001', icon: 'no-audit' },
      { label: '被退回', value: 25, path: 'generic-reserve-apply', status: '001', icon: 'has-back' },
    ]
  },
  {
    name: '专项项目',
    icon: 'reserve',
    infoList: [
      { label: '未送审', value: 25, path: 'generic-reserve-apply', status: '001', icon: 'no-audit' },
      { label: '被退回', value: 25, path: 'generic-reserve-apply', status: '001', icon: 'has-back' },
    ]
  },
  {
    name: '备选项目',
    icon: 'standby',
    infoList: [
      { label: '未送审', value: 25, path: 'generic-reserve-apply', status: '001', icon: 'no-audit' },
      { label: '被退回', value: 25, path: 'generic-reserve-apply', status: '001', icon: 'has-back' },
    ]
  }
]

</script>

<style lang="scss" scoped>
</style>